package cn.NewsServiceImpl;

import cn.NewsDao.NewsDao1;
import cn.NewsDaoImpl.NewsDaoImpl1;
import cn.NewsService.NewsService;
import cn.entity.News1;

import java.util.ArrayList;
import java.util.List;

public class NewsServiceImpl implements NewsService {

    //实例化Dao接口
    private  NewsDao1 newsDao = new NewsDaoImpl1();


    @Override
    public List<News1> ServiceSelectAll() {
        //先查询 Redis缓存数据
       List<News1> list= newsDao.getNewsList();
        if(list.size()>0){
            return newsDao.getNewsList();
        }else {
          return  new ArrayList<News1>();
        }
    }

    @Override
    public News1 ServiceSselectById(int id) {
        return null;
    }

    @Override
    public int ServiceSinsertNews(News1 news) {
        return 0;
    }

    @Override
    public int ServiceSdeleteById(int id) {
        return 0;
    }

    @Override
    public int ServiceSdeleteByName(String name) {
        return 0;
    }

    @Override
    public int ServiceSupdateById(int id) {
        return 0;
    }

    @Override
    public int ServiceSupdateByByName(String name) {
        return 0;
    }
}
